package com.tongji.housediy.model
{
	import com.tongji.housediy.vo.House;
	
	import mx.collections.ArrayCollection;
	
	import org.robotlegs.mvcs.Actor;
	
	/**
	 * 
	 * @author yanghanbing
	 * 2011/4/11
	 */ 
	[Bindable]
	public class HouseModel extends Actor
	{
		public var houseArray:ArrayCollection;		
		
		public var sampleHouses:ArrayCollection;
		
		public var houseID:int = 0;
		public var house:House;
		
		public function HouseModel()
		{
			super();
		}
		
		public function updateHouseArray(houseModel:ArrayCollection):void
		{
			if (houseModel != null)
			{
				if (houseModel.length == 0)
				{
					houseArray.removeAll();
				}
				else if (houseModel.length > 0)
				{
					houseArray = houseModel;
				}
			}		
		}	
		
		public function updateSampleHouse(sampleHouses:ArrayCollection):void
		{
			this.sampleHouses = sampleHouses;
		}
		
		public function updateHouseDetail(houseArray:ArrayCollection):void
		{
			house = houseArray.getItemAt(0) as House;
		}
	}
}